<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8" />
  <title>Configure a command for a specific locale</title>
  <style>
    table, th, td {
      border: 1px solid black;
      border-collapse: collapse;
    }
    th, td {
      padding: 5px;
    }
    th {
      font-weight: bold;
    }
  </style>
</head>
<body>
  ## Configure a command for a specific locale

  <div xmlns="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-10T23:25:53">This sample demonstrates how resource files are used to configure an application's interface for a specific culture. This is important when developing localized applications that must use different resources at run time, depending on the user's language and location (culture). </div>
  <div xmlns="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-10T23:25:53"> </div>
  <div xmlns="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-10T23:25:53">The ResourceManager examines the application's thread user interface (UI) culture (for example, System.Threading.Thread.CurrentThread.CurrentUICulture) to determine which resource file to employ. Typically, the thread UI culture is automatically set by the operating system, but it can be temporarily overwritten to allow you to test different resource files.</div>
  <div xmlns="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-10T23:25:53"> </div>
  <div xmlns="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-10T23:25:53">The application in this sample creates a tool, a command, a menu, and a pop-up menu and employs resource files to set their Icon Bitmap, ToolTip, Caption, and Message properties. The application contains three resource files—one for each of the following cultures: English (United States), French (France), and Spanish (Spain)—and are named Resources.en-US.resX, Resources.fr-FR.resX, and Resources.es-ES.resX, respectively. There is also a default resource file named Resources.resX. </div>  

```
Language:              C#, VB
Subject:               Controls
Organization:          Esri, http://www.esri.com
Date:                  10/17/2019
ArcObjects SDK:        10.8
Visual Studio:         2017, 2019
.NET Target Framework: 4.5
```

### Resources

* [ArcObjects .NET API Reference online](http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm)  
* [Sample Data Download](../../releases)  
* [What's new](http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#91cabc68-2271-400a-8ff9-c7fb25108546.htm)  
* [Download the ArcObjects SDK for .Net from MyEsri.com](https://my.esri.com/)  

### Usage
1. Open the project file in the language of your choice, and build the solution to create an ArcGIS Engine application. This loads a command, tool, and menu using the current UI culture.   
1. Load some map data and navigate around using the tools and scroll bars in the application.  
1. Click the Culture button to use the command to identify the current UI culture this application is using.  
1. Use the Timestamp tool (with the blue clock image) to place the current time stamp on the PageLayout control. Notice that this matches the format for the selected culture.  
1. The default culture is French (France). To use a different resource file, reset the thread to a new culture by editing the Form1_Load method in either Controls/CulturalResources.cs (C#) or Controls/CulturalResources.vb (VB .NET). For example, to use the French resource file (Resources.fr-FR.resX), a French culture in the Form1_Load with System.Globalization.CultureInfo.CreateSpecificCulture has been created. Then set the current threading UI Culture to that culture. The code to set the culture to either English or Spanish is contained in that function as well and is commented out. To use a different culture, change those that are commented out and the one that is active, then recompile and rerun the sample.  
1. To create your own resource file for another culture, copy the Resource.en-US.resX file in Solution Explorer and paste it into the CultureSamples project. Rename this file the appropriate culture name. For example, change en-US to ru-RU for Russian (Russia). Change the value of any strings, but remember that the names must match those defined in the default resource file. Similarly, you can change the file name of any images, but ensure that the name is left unchanged.  

#### See Also  
[IToolbarMenu2 Interface](http://desktop.arcgis.com/search/?q=IToolbarMenu2%20Interface&p=0&language=en&product=arcobjects-sdk-dotnet&version=&n=15&collection=help)  

---------------------------------

#### Licensing  
<table><tr><th> Development licensing </th><th> Deployment licensing </th></tr>
<tr><td> Engine Developer Kit </td><td> Engine </td></tr>  
<tr><td>  </td><td> ArcGIS Desktop Basic </td></tr>  
<tr><td>  </td><td> ArcGIS Desktop Standard </td></tr>  
<tr><td>  </td><td> ArcGIS Desktop Advanced </td></tr>  
</table>
</body>
</html>